<template>
    <div class="child">
      <h2>child子组件部分</h2>
      <p>{{message}}</p>
      <button @click="sendMsgToParent">向父组件传递数据</button>
    </div>
</template>

<script>
    export default {
      name: "child",
      data(){
          return {

          }
      },
      props:["message"],
      methods:{
        sendMsgToParent(){
          this.$emit("emitMsgToParent","this message from child ");
        }
      }
    }
</script>

<style scoped>

</style>
